aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/(profile)/notes/+page.server.ts
blob: b7186bc0fe5a1c4c792208de43e3cdbf230f3722 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { get } from "$lib/utils";
import { error } from "@sveltejs/kit";

export async function load({ parent }) {
	try {
		const { subject } = await parent();
		const events = await get(`/${subject.pubkey}/events`);
		return { events };
	} catch (e) {
		console.log(e);
		error(500, { message: "Failed to get events" });
	}
}